<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="__CSS__/style_forum.css">
	<link rel="stylesheet" href="__CSS__/style_detail.css">
	<link rel="stylesheet" href="__CSS__/reset.css">
	<title>{$mes.m_title} - ThinkPHP</title>
	<script type="text/javascript" src="__JS__/jquery-3.4.1.min.js"></script>
	<script type="text/javascript" src="__JS__/loadinghtml.js"></script>
	<script type="text/javascript" src="__JS__/DropDown.js"></script>
	<script type="text/javascript">
		function check() {
			var inputFile = document.getElementById("rcon").value;
			if (inputFile.length>0) {
				return true;
			} else {
				alert("请先填写内容再提交");
				return false;
			}
		}
	</script>
</head>
<body>
	<div id="header" class="top">
		<div id="hd-main">
			<a id="alink" href="{:url('index/index')}" title="返回首页"></a>
			<ul id="main-nav">
				<li><a href="{:url('index/index')}">首页</a></li>
				<li id="triggerdown" style="background-color: #656565">
					<a href="{:url('index/view',['s_id'=>0,'ot'=>'m_createat'])}">论坛</a>
					<ul id="dropdown">
						<li><a href="{:url('index/view',['s_id'=>0,'ot'=>'m_createat'])}">全部</a></li>
						{volist name="sec" id="secRow"}
						<li><a href="{:url('index/view',['s_id'=>$secRow.s_id,'ot'=>'m_createat'])}">{$secRow.s_name}</a></li>
						{/volist}
					</ul>
				</li>
				<li><a href="{:url('index/pa')}">修改密码</a></li>
				<li><a href="{:url('index/me')}">上传头像</a></li>
				<li><a href="{:url('user/login')}">登录</a></li>
				<li><a href="{:url('user/reg')}">注册</a></li>
				<li><a href="{:url('index/logout')}">退出</a></li>
				<li><a href="{:url('user/contact')}">联系我们</a></li>
			</ul>
			<div id="header-bar">
				{eq name=':session("user")' value=''}
				<h3>欢迎你，请登录</h3>
				<div id="userloginmes">
					<a href="{:url('user/login')}" id="unlogin">
						<b></b>
					</a>
					<ul>
						<li><a href="{:url('user/login')}">登录</a></li>
						<li><a href="{:url('user/reg')}">注册</a></li>
					</ul>
				</div>
				{else/}
				<h3>欢迎你，{:session('user')}</h3>
				<div id="userloginmes">
					<a href="" id="unlogin">
						<img src="__POT__/{:session('uimg')}" width="24px" height="24px">
					</a>
					<ul>
						<li><a href="{:url('index/collect')}">我的收藏</a></li>
						<li><a href="{:url('index/logout')}">退出</a></li>
					</ul>
				</div>
				{/eq}
			</div>
		</div>
	</div>
	<div id="main">
		<div id="wrapper">
			{if input('page')==1 || !input('page')}
			<div class="box" id="detail-box">
				<div id="detail-hd">
					<div id="t-head"><h2>{$mes.m_title}</h2></div>
					<div id="t-foot">
						<span>浏览：{$mes.m_browse}</span>
						<span>发布日期：{$mes.m_createat | date="Y/m/d"}</span>
						<span>分类：{$mes.s_name}</span>
					</div>
				</div>
				<div id="detail-bd">{$mes.m_content}</div>
			</div>
			{/if}
			<div class="box" id="comment">
				<div id="tab-nav">
					<span class="item selected">评论（{$res->total()}）</span>
					<span class="item">相关</span>
				</div>
				<div id="tab-wrap">
					{volist name='res' id='resRow' length='6'}
					<div class="cmt-item">
						<a href="" class="avatar">
							<img src="__POT__/{$resRow.u_img}" width="44px" height="44px">
						</a>
						<div>
							<a href="" class="reply-btn">回复</a>
							<span id="username">{$resRow.u_nick}</span>
							<span id="commment-time">{$resRow.r_createat | date="Y年m月d日 H:i"}</span>
						</div>
						<div id="cmt-txt">{$resRow.r_content}</div>
					</div>
					{/volist}
					{eq name=":session('user')" value=''}
					<div id="login-tip">
						您需要登录后才可以评论 <a href="{:url('user/login')}">登录</a> | <a href="{:url('user/reg')}">立即注册</a>
					</div>
					{else/}
					<form class="cmt-item" action="{:url('index/doRes',['m_id'=>$mes.m_id])}" method="post" onsubmit="javascript:return check();">
						<span class="avatar">
							<img src="__POT__/{:session('uimg')}" width="44px" height="44px">
						</span>
						<div id="cmt-textarea">
							<textarea name="rcon" id="rcon" placeholder="我也来说两句..."></textarea>
						</div>
						<div id="cmt-ft">
							<input type="submit" class="cmt-btn" value="评论&nbsp;[&nbsp;Ctrl+Enter&nbsp;]">
							<span class="c-tips">评论支持使用[code][/code]标签添加代码</span>
						</div>
					</form>
					{/eq}
				</div>
			</div>
			{if $page}
			<nav id="rpage">{$page | raw}</nav>
			{/if}
		</div>
		<div id="sidebar">
			<div id="sn-wrap">
				<dl class="count-item" id="collect">
					<dt class="cit"><i></i>收藏</dt>
					<dd class="cib">-</dd>
				</dl>
				{if $lu}
				<dl class="disabled count-item" id="like" onclick="location.replace('{:url(\'index/likeCount\',[\'m_id\'=>$mes.m_id])}')" title="取消点赞">
					<dt class="cit"><i></i>已赞</dt>
					<dd class="cib">{$lf}</dd>
				</dl>
				{else/}
				<dl class="enabled count-item" id="like" onclick="location.replace('{:url(\'index/likeCount\',[\'m_id\'=>$mes.m_id])}')">
					<dt class="cit"><i></i>赞</dt>
					<dd class="cib">{$lf}</dd>
				</dl>
				{/if}
				<a href="#tab-wrap" class="count-item" id="cmt">
					<span class="cit"><i></i>评论</span>
					<span class="cib">{$res->total()}</span>
				</a>
			</div>
			<div class="box" id="promulgator">
				<div class="avatar">
					<img src="__POT__/{$mes.u_img}" width="44px" height="44px">
				</div>
				<div id="una">{$mes.u_nick}</div>
				<span style="margin-right: 10px;">积分：100</span>
				<span>等级：LV1</span>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div id="footer"></div>
</body>
</html>